<?php

namespace App\Service\Message\v1_1_0;

use App\Model\PayOrder;
use App\Model\User;
use App\Model\UserProfile;
use App\Service\BaseService;

/**
 * 随心聊入口信息
 */
class QuickcallInfoService extends BaseService
{
    public function handle()
    {
        $userId = $this->getUserId();
        $blurAvatars = UserProfile::getBlurAvatars(3);
        $profile = UserProfile::getProfile($userId);
        //随心聊
        $showQuick = $profile->gender == 1 ? 1 : 0;
        $ret['show'] = $this->appId != 1 ? 0 : $showQuick;
        //视频
        $ret['video'] = [
            'title' => '视频随心聊',
            'text' => '实时缘分，在线视频匹配中…',
            'player_num' => mt_rand(100, 200),
            'avatars' => $blurAvatars
        ];
        //语音
        $ret['voice'] = [
            'title' => '语音随心聊',
            'text' => '性感萝莉御姐',
        ];
        if (User::checkValidVersion($this->curVersion, $this->appId, [1 => '1.2.2', 2 => '1.2.5'])) {
            $ret['show'] = 0;
        }
        return $ret;
    }
}
